-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
util: improve styleText performance #60133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The validation for when to colorize or not was happening in a loop. Instead, it is now done once up front instead.
I think the side effect is that the input is no longer validated when colorize is disabled |
@marco-ippolito yes, that is correct. It is the question if we need to validate the colors if they are not used. |
I lean more on the yes we should always validate the input (that's why when I previously worked on this api I left the check in the loop) but I really dont have a strong opinion, just wanted to highlight this change |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60133 +/- ##
==========================================
+ Coverage 88.52% 88.53% +0.01%
==========================================
Files 703 703
Lines 207825 207807 -18
Branches 40003 40008 +5
==========================================
+ Hits 183976 183992 +16
+ Misses 15862 15815 -47
- Partials 7987 8000 +13
🚀 New features to boost your workflow:
|
The validation for when to colorize or not was happening in a loop. Instead, it is now done once up front instead.